home *** CD-ROM | disk | FTP | other *** search
-
- /*
- *
- * MOS106 : ボタンの押下情報の読み取り
- *
- */
-
- #include <stdio.h>
- #include <dos.h>
-
- unsigned int MOS_on_status(unsigned char no,unsigned char *status,unsigned char *count,signed int *horizon,signed int *vertical) {
- union REGS inregs, outregs;
- struct SREGS segregs;
-
- segread(&segregs);
- inregs.h.ah=0x05;
- inregs.h.al=no;
- int86x(0x99,&inregs,&outregs,&segregs);
- *status=(unsigned char)outregs.h.ch;
- *count=(unsigned char)outregs.h.cl;
- *horizon=(signed int)outregs.x.dx;
- *vertical=(signed int)outregs.x.bx;
- return (unsigned int)outregs.h.ah;
- }